<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ahref="http://lcalhost" title="主页"></a>
    <div index="1"data-index="2">7-2的学习内容,div</div>
    <p>我是p元素</p>
    <script>
        console.log($("a").prop("href"));
        $("a").prop("title","首页");
        console.log($("div").attr("index"));
        console.log($("div").attr("data-index"));
        $("div").attr("index",3);
        $("div").attr("data-index",4);
        $("div").data("uname","andy");
        console.log($("p").data("uname"));
        console.log($("div").data("index"));
    </script>
</body>
</html>